package com.hxexp.weixin.test;

import org.junit.Assert;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;

import com.hxexp.weixin.common.math.RandomUtil;
import com.hxexp.weixin.test.runner.JUnit4WithLogClassRunner;

/**
 * 随机数工具测试
 * @author wang.bin
 *
 */
@RunWith(JUnit4WithLogClassRunner.class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class RandomUtilTester {

    @Test
    public void testCase01() {
        int length = 3;
        int expected = 3;
        String returnValue = RandomUtil.getRandomString(length);
        System.out.println(returnValue);
        Assert.assertEquals(expected, returnValue.length());
    }

    @Test
    public void testCase02() {
        String returnValue = RandomUtil.getUUID();
        System.out.println(returnValue);
    }

    @Test
    public void testCase03() {
        int length = 10;
        int expected = 10;
        String returnValue = RandomUtil.getRandomNumber(length);
        System.out.println(returnValue);
        Assert.assertEquals(expected, returnValue.length());
    }
}
